<template>
  <div class="content-block">
    <div class="content-block__header">
      <span class="content-block__title">{{ title }}</span>
      <div class="content-block__extra">
        <slot name="extra"></slot>
      </div>
    </div>
    <div class="content-block__inner">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "ContentBlock",
  props: {
    title: String,
  },
};
</script>

<style scoped lang="scss">
.content-block {
  width: 100%;
  margin-bottom: 20px;
  &__header {
    position: relative;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    background: #f4f5f6;
    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      width: 4px;
      background: #1890ff;
    }
  }
  &__title {
    font-size: 14px;
    margin-right: 40px;
  }
  &__extra {
    display: flex;
    align-items: center;
    ::v-deep .el-button--text {
      padding: 0;
      font-size: 12px;
    }
  }
  &__inner {
    padding: 15px;
  }
}
</style>
